﻿using System;
using CTEM.Controllers.Global;
using System.Collections.Generic;

/// <summary>
/// Entity for table Worker
/// </summary>

namespace CTEM.Models
{
    public class WorkerDTO
    {
        public long WorkerID { get; set; }
        public string Fullname { get; set; }
        public string Position { get; set; }
        public long TotalSalary { get; set; }
        public long Salary { get; set; }
        public long Status { get; set; }
        public double ManDate { get; set; }

        public long WorkersSalaryID { get; set; }
        public List<DayWorkingDTO> dayWorking { get; set; }





        public WorkerDTO()
        {
            Fullname = "";
            Position = "";
            Status = 0;
            ManDate = 0;
            WorkerID = 0;
            Salary = 0;
            TotalSalary = 0;
            dayWorking = null;         
        }

        public override bool Equals(object obj)
    {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof(WorkerDTO)) return false;
            return Equals((WorkerDTO)obj);
        }


        public bool Equals(WorkerDTO other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return Equals(other.WorkerID, WorkerID);
        }

        public static bool operator ==(WorkerDTO left, WorkerDTO right)
        {
            return Equals(left, right);
        }

        public static bool operator !=(WorkerDTO left, WorkerDTO right)
        {
            return !Equals(left, right);
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
    }
}
